package org.lyk.blogservice.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.lyk.blogservice.dto.BlogDTO;
import org.lyk.blogservice.dto.PageDTO;
import org.lyk.blogservice.dto.ReadCommentDTO;
import org.lyk.blogservice.dto.ReadDTO;
import org.lyk.blogservice.pojo.Blog;

import java.util.Date;
import java.util.List;
import java.util.Map;


public interface IBlogService extends IService<Blog> {
    void saveBlog(Blog blog);

    ReadDTO ReadBlog(Long id,String UserInfoKey);

    PageDTO<BlogDTO> getBlogByPage(int current, int pageSizem, String type);

    List<ReadCommentDTO> getBlogComment(String blogId,String userInfoKey);

    Boolean changeCommentKudos(Long commentId,Byte bytes);

    Boolean changeReplyKudos(Long replyId,Byte bytes);

    List<Long> getUserBlogNum(Long userId);

    PageDTO<BlogDTO> getBlogByName(int current,int pageSize,String blogName);

    PageDTO<BlogDTO> getBlogByUserId(int current,int pageSize,Long userId);

    PageDTO<BlogDTO> getBlogByTypeList(int current,int pageSize,List<String> typeList);

    PageDTO<BlogDTO> getBlogByIds(int current, int pageSize, List<Long> blogs);

    List<BlogDTO> getHotBlogs();

    Map<String,Long> getIncreaseBlog();

    Map<String,Long> getAllTypeNum();

    String getBlogListByAdmin(String blogName,
                              String authorName,
                              Date startDate,
                              Date endDate,  // spring框架默认是不支持前端 date的iso类型  所以要设置
                              String status,
                              Integer currentPage) throws JsonProcessingException;

}
